
package com.cgmnx.admin.common.exception;

/**
 * 异常
 */
public class CgmnxException extends RuntimeException {

    private int errorCode;

    public CgmnxException(String message) {
        super(message);
    }

    public CgmnxException(String msgTemplate, Object... args) {
        super(String.format(msgTemplate, args));
    }

    public CgmnxException(String message, Throwable cause) {
        super(message, cause);
    }

    public CgmnxException(Throwable cause, String msgTemplate, Object... args) {
        super(String.format(msgTemplate, args), cause);
    }

    public CgmnxException(Throwable cause) {
        super(cause);
    }


    public CgmnxException(String message, int code) {
        super(message);
        this.errorCode = code;
    }

    public CgmnxException(int code, String msgTemplate, Object... args) {
        super(String.format(msgTemplate, args));
        this.errorCode = code;
    }

    public CgmnxException(String message, Throwable cause, int code) {
        super(message, cause);
        this.errorCode = code;
    }

    public CgmnxException(Throwable cause, int code, String msgTemplate, Object... args) {
        super(String.format(msgTemplate, args), cause);
        this.errorCode = code;

    }

    public CgmnxException(Throwable cause, int code) {
        super(cause);
        this.errorCode = code;
    }

    public CgmnxException(int code) {
        this.errorCode = code;
    }

    public int getErrorCode() {
        return errorCode;
    }
}